<template>
	<!-- 瀑布流布局列表 -->
	<view class="waterfall">
		<view class="waterfall-list">
			<view class="waterfall-item" v-for="(item, index) in list" :key="index">
				<image :src="item.img" mode="widthFix"></image> <!-- widthFix 自适应图片 -->
				<!-- <view class="waterfall-content">
					 自定义内容就可以
				</view> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			// 数据流
			list: {
				type: Array,
				default: []
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			
		}
	}
</script>

<style lang="scss">
.waterfall {
		padding: 0rpx;
	}
	
	.waterfall-list {
		column-count: 2;
		column-gap: 20rpx;
	}
	
	.waterfall-item {
		width: 100%;
		//box-sizing: border-box;
		//overflow: hidden;
		//background-color: #fff;
		break-inside: avoid;
		/*避免在元素内部插入分页符*/
		//box-sizing: border-box;
		margin-bottom: 20rpx;
		//background: #2B2135;
		box-shadow: 0rpx 0rpx 0rpx 0rpx rgba(16, 16, 27, 0.58);
		border-radius: 20rpx;
		//background: red;
		image {
			width: 100%;
			height: 100%;
		}
	}
</style>
